package cn.yunyichina.provider.guide.entity;

import java.util.Calendar;

import org.apache.commons.lang.math.NumberUtils;

import cn.yunyichina.provider.guide.GuideConstants;
import cn.yunyichina.provider.iface.entity.base.OrderExtVo;

/**
*
* @Author auto_gen_by_tool
* @CreatedTime 2017-04-11 11:49:24
*/
public class ClinicRecordVo {
	
	private String payStatuss;
	
	
	private String clinicStatuss;
	
	
     public String getPayStatuss() {
		return payStatuss;
	}
    
	public void setPayStatuss(String payStatuss) {
		this.payStatuss = payStatuss;
	}

	
	public String getClinicStatuss() {
		return clinicStatuss;
	}

	
	public void setClinicStatuss(String clinicStatuss) {
		this.clinicStatuss = clinicStatuss;
	}

	/**/
     private String id;
     public void setId(String id) {
          this.id = id;
     }
     public String getId() {
          return id;
     }

     /*医院ID*/
     private String hospitalId;
     public void setHospitalId(String hospitalId) {
          this.hospitalId = hospitalId;
     }
     public String getHospitalId() {
          return hospitalId;
     }

     /*医院代码*/
     private String hospitalCode;
     public void setHospitalCode(String hospitalCode) {
          this.hospitalCode = hospitalCode;
     }
     public String getHospitalCode() {
          return hospitalCode;
     }

     /*医院名称*/
     private String hospitalName;
     public void setHospitalName(String hospitalName) {
          this.hospitalName = hospitalName;
     }
     public String getHospitalName() {
          return hospitalName;
     }

     /*分院ID*/
     private String branchId;
     public void setBranchId(String branchId) {
          this.branchId = branchId;
     }
     public String getBranchId() {
          return branchId;
     }

     /*分院编码*/
     private String branchCode;
     public void setBranchCode(String branchCode) {
          this.branchCode = branchCode;
     }
     public String getBranchCode() {
          return branchCode;
     }

     /*appid*/
     private String appId;
     public void setAppId(String appId) {
          this.appId = appId;
     }
     public String getAppId() {
          return appId;
     }

     /**/
     private String appCode;
     public void setAppCode(String appCode) {
          this.appCode = appCode;
     }
     public String getAppCode() {
          return appCode;
     }

     /*支付状态：1：未支付, 2：已支付3：已退费,4订单支付中,5订单退费中,6订单已经关闭,7未退费*/
     private Integer payStatus;
     public void setPayStatus(Integer payStatus) {
          this.payStatus = payStatus;
     }
     public Integer getPayStatus() {
          return payStatus;
     }

     /*诊疗卡类型1院内诊疗卡,2社保卡,3医保卡,4区域健康卡,5身份证,6市民卡,7患者唯一标识,8临时诊疗卡,9医疗证,10银联卡,11住院号,*/
     private Integer cardType;
     public void setCardType(Integer cardType) {
          this.cardType = cardType;
     }
     public Integer getCardType() {
          return cardType;
     }

     /*绑定诊疗卡号*/
     private String cardNo;
     public void setCardNo(String cardNo) {
          this.cardNo = cardNo;
     }
     public String getCardNo() {
          return cardNo;
     }

     /*第3方平台的表示openId*/
     private String openId;
     public void setOpenId(String openId) {
          this.openId = openId;
     }
     public String getOpenId() {
          return openId;
     }

     /**/
     private String userId;
     public void setUserId(String userId) {
          this.userId = userId;
     }
     public String getUserId() {
          return userId;
     }

     /*是否发生异常  0 否 1是*/
     private Integer isException;
     public void setIsException(Integer isException) {
          this.isException = isException;
     }
     public Integer getIsException() {
          return isException;
     }

     /*是否处理成功   1是   0 否*/
     private Integer isHandleSuccess;
     public void setIsHandleSuccess(Integer isHandleSuccess) {
          this.isHandleSuccess = isHandleSuccess;
     }
     public Integer getIsHandleSuccess() {
          return isHandleSuccess;
     }

     /*处理次数*/
     private Integer handleCount;
     public void setHandleCount(Integer handleCount) {
          this.handleCount = handleCount;
     }
     public Integer getHandleCount() {
          return handleCount;
     }

     /*异常处理日志*/
     private String handleLog;
     public void setHandleLog(String handleLog) {
          this.handleLog = handleLog;
     }
     public String getHandleLog() {
          return handleLog;
     }

     /**/
     private String patientName;
     public void setPatientName(String patientName) {
          this.patientName = patientName;
     }
     public String getPatientName() {
          return patientName;
     }

     /*订单号*/
     private String orderNo;
     public void setOrderNo(String orderNo) {
          this.orderNo = orderNo;
     }
     public String getOrderNo() {
          return orderNo;
     }

     /*订单号哈希*/
     private Long orderNoHashVal;
     public void setOrderNoHashVal(Long orderNoHashVal) {
          this.orderNoHashVal = orderNoHashVal;
     }
     public Long getOrderNoHashVal() {
          return orderNoHashVal;
     }

     /*退单号*/
     private String refundOrderNo;
     public void setRefundOrderNo(String refundOrderNo) {
          this.refundOrderNo = refundOrderNo;
     }
     public String getRefundOrderNo() {
          return refundOrderNo;
     }

     /*退单HIS方的编号*/
     private String refundHisordNo;
     public void setRefundHisordNo(String refundHisordNo) {
          this.refundHisordNo = refundHisordNo;
     }
     public String getRefundHisordNo() {
          return refundHisordNo;
     }

     /*第三方支付流水号*/
     private String agtOrdNum;
     public void setAgtOrdNum(String agtOrdNum) {
          this.agtOrdNum = agtOrdNum;
     }
     public String getAgtOrdNum() {
          return agtOrdNum;
     }

     /*第三方退费流水号*/
     private String agtRefundOrdNum;
     public void setAgtRefundOrdNum(String agtRefundOrdNum) {
          this.agtRefundOrdNum = agtRefundOrdNum;
     }
     public String getAgtRefundOrdNum() {
          return agtRefundOrdNum;
     }

     /*费用说明*/
     private String feeDesc;
     public void setFeeDesc(String feeDesc) {
          this.feeDesc = feeDesc;
     }
     public String getFeeDesc() {
          return feeDesc;
     }

     /*是否已被支付回调  1 是  0 否*/
     private Integer isHadCallBack;
     public void setIsHadCallBack(Integer isHadCallBack) {
          this.isHadCallBack = isHadCallBack;
     }
     public Integer getIsHadCallBack() {
          return isHadCallBack;
     }

     /*记录名称*/
     private String recordTitle;
     public void setRecordTitle(String recordTitle) {
          this.recordTitle = recordTitle;
     }
     public String getRecordTitle() {
          return recordTitle;
     }

     /*HIS写单失败后，将错误原因写入数据库*/
     private String failureMsg;
     public void setFailureMsg(String failureMsg) {
          this.failureMsg = failureMsg;
     }
     public String getFailureMsg() {
          return failureMsg;
     }

     /*1有效   0 无效*/
     private Integer isValid;
     public void setIsValid(Integer isValid) {
          this.isValid = isValid;
     }
     public Integer getIsValid() {
          return isValid;
     }

     /*门诊费ID*/
     private String mzfeeId;
     public void setMzfeeId(String mzfeeId) {
          this.mzfeeId = mzfeeId;
     }
     public String getMzfeeId() {
          return mzfeeId;
     }

     /*对应His订单号列表, 英文逗号隔开*/
     private String payIds;
     public void setPayIds(String payIds) {
          this.payIds = payIds;
     }
     public String getPayIds() {
          return payIds;
     }

     /*医保类型*/
     private String medicareType;
     public void setMedicareType(String medicareType) {
          this.medicareType = medicareType;
     }
     public String getMedicareType() {
          return medicareType;
     }

     /*单位：分,总金额*/
     private Integer totalFee;
     public void setTotalFee(Integer totalFee) {
          this.totalFee = totalFee;
     }
     public Integer getTotalFee() {
          return totalFee;
     }

     /*单位：分,医保金额*/
     private Integer medicareFee;
     public void setMedicareFee(Integer medicareFee) {
          this.medicareFee = medicareFee;
     }
     public Integer getMedicareFee() {
          return medicareFee;
     }

     /*单位：分,实付金额*/
     private Integer payFee;
     public void setPayFee(Integer payFee) {
          this.payFee = payFee;
     }
     public Integer getPayFee() {
          return payFee;
     }

     /*条形码*/
     private String barcode;
     public void setBarcode(String barcode) {
          this.barcode = barcode;
     }
     public String getBarcode() {
          return barcode;
     }

     /*医生名称*/
     private String doctorName;
     public void setDoctorName(String doctorName) {
          this.doctorName = doctorName;
     }
     public String getDoctorName() {
          return doctorName;
     }

     
     private String deptName;
     public void setDeptName(String deptName) {
          this.deptName = deptName;
     }
     public String getDeptName() {
          return deptName;
     }

     
     private Integer tradeMode;
     public void setTradeMode(Integer tradeMode) {
          this.tradeMode = tradeMode;
     }
     public Integer getTradeMode() {
          return tradeMode;
     }

     
     private Integer payMode;
     public void setPayMode(Integer payMode) {
          this.payMode = payMode;
     }
     public Integer getPayMode() {
          return payMode;
     }

     
     private String hisOrdNo;
     public void setHisOrdNo(String hisOrdNo) {
          this.hisOrdNo = hisOrdNo;
     }
     public String getHisOrdNo() {
          return hisOrdNo;
     }

     /*收据号*/
     private String receiptNum;
     public void setReceiptNum(String receiptNum) {
          this.receiptNum = receiptNum;
     }
     public String getReceiptNum() {
          return receiptNum;
     }

     /*0待缴费,,1已缴费,,2第三方缴费失败(查询第三方支付接口返回缴费失败),3写入His异常（第三方缴费成功，写入His异常）,4缴费关闭（第三方缴费成功，写入His明确失败，退费给用户成功，则缴费关闭）,5退费异常（第三方缴费成功，写入His明确失败，退费给用户失败/异常，这个需要走人工流程）,6写入His失败（第三方缴费成功，写入His失败(中间状态)）,7 业务异常需 人工处理,8业务异常需 窗口处理,9用户取消,20窗口退费成功,21窗口退费异常,30窗口部分退费（His发起了，不管成功还是失败，都是部分退费）,31窗口部分退费成功,32窗口部分退费失败,33窗口部分退费异常,34后台退费成功,35后台退费失败,*/
     private Integer clinicStatus;
     public void setClinicStatus(Integer clinicStatus) {
          this.clinicStatus = clinicStatus;
     }
     public Integer getClinicStatus() {
          return clinicStatus;
     }

     /*医院返回的取药信息*/
     private String hisMessage;
     public void setHisMessage(String hisMessage) {
          this.hisMessage = hisMessage;
     }
     public String getHisMessage() {
          return hisMessage;
     }

     /*创建时间*/
     private Long createTime;
     public void setCreateTime(Long createTime) {
          this.createTime = createTime;
     }
     public Long getCreateTime() {
          return createTime;
     }
     private String beginCreateTime;
     private String endCreateTime;


     public String getBeginCreateTime() {
		return beginCreateTime;
	}
	public void setBeginCreateTime(String beginCreateTime) {
		this.beginCreateTime = beginCreateTime;
	}
	public String getEndCreateTime() {
		return endCreateTime;
	}
	public void setEndCreateTime(String endCreateTime) {
		this.endCreateTime = endCreateTime;
	}

	/*更新时间*/
     private Long updateTime;
     public void setUpdateTime(Long updateTime) {
          this.updateTime = updateTime;
     }
     public Long getUpdateTime() {
          return updateTime;
     }

     /*支付时间*/
     private Long payTime;
     public void setPayTime(Long payTime) {
          this.payTime = payTime;
     }
     public Long getPayTime() {
          return payTime;
     }

     /*退费时间*/
     private Long refundTime;
     public void setRefundTime(Long refundTime) {
          this.refundTime = refundTime;
     }
     public Long getRefundTime() {
          return refundTime;
     }

     /*电话号码*/
     private String patientMobile;
     public void setPatientMobile(String patientMobile) {
          this.patientMobile = patientMobile;
     }
     public String getPatientMobile() {
          return patientMobile;
     }

     /*个人账户结算金额,医保结算时必输,单位：分*/
     private String accountAmout;
     public void setAccountAmout(String accountAmout) {
          this.accountAmout = accountAmout;
     }
     public String getAccountAmout() {
          return accountAmout;
     }

     /*统筹基金结算金额,医保结算时必输,单位：分*/
     private String medicareAmout;
     public void setMedicareAmout(String medicareAmout) {
          this.medicareAmout = medicareAmout;
     }
     public String getMedicareAmout() {
          return medicareAmout;
     }

     /*医保结算时必输,单位：分,记账合计 = 个人账户结算金额 + 统筹基金结算金额*/
     private String insuranceAmout;
     public void setInsuranceAmout(String insuranceAmout) {
          this.insuranceAmout = insuranceAmout;
     }
     public String getInsuranceAmout() {
          return insuranceAmout;
     }

     /*是否医保 1是 0否*/
     private String isInsurance;
     public void setIsInsurance(String isInsurance) {
          this.isInsurance = isInsurance;
     }
     public String getIsInsurance() {
          return isInsurance;
     }

     /*医保结算项目代码*/
     private String settlementId;
     public void setSettlementId(String settlementId) {
          this.settlementId = settlementId;
     }
     public String getSettlementId() {
          return settlementId;
     }

     /*结算金额 单位:分*/
     private String settlementFee;
     public void setSettlementFee(String settlementFee) {
          this.settlementFee = settlementFee;
     }
     public String getSettlementFee() {
          return settlementFee;
     }

     /*医疗费用支付项目代码*/
     private String paymentId;
     public void setPaymentId(String paymentId) {
          this.paymentId = paymentId;
     }
     public String getPaymentId() {
          return paymentId;
     }

     /*支付金额单位：分*/
     private String paymentFee;
     public void setPaymentFee(String paymentFee) {
          this.paymentFee = paymentFee;
     }
     public String getPaymentFee() {
          return paymentFee;
     }

     /*退款流水号*/
     private String cancelSerialNo;
     public void setCancelSerialNo(String cancelSerialNo) {
          this.cancelSerialNo = cancelSerialNo;
     }
     public String getCancelSerialNo() {
          return cancelSerialNo;
     }

     /*退款单据号*/
     private String cancelBillNo;
     public void setCancelBillNo(String cancelBillNo) {
          this.cancelBillNo = cancelBillNo;
     }
     public String getCancelBillNo() {
          return cancelBillNo;
     }

     /**/
     private String inviteCode;
     public void setInviteCode(String inviteCode) {
          this.inviteCode = inviteCode;
     }
     public String getInviteCode() {
          return inviteCode;
     }
     private String toDate(Long longTime) {
    	 Calendar c = Calendar.getInstance();
    	 if (longTime == null || longTime == 0) {
     		return GuideConstants.YYYYMMDDHHMMSS.format(c.getTime());
     	}
     	c.setTimeInMillis(longTime);
     	return GuideConstants.YYYYMMDDHHMMSS.format(c.getTime());
     }

    private String toDate(String strLong) {
    	
    	
    	if ( ! NumberUtils.isNumber(strLong)) {
    		return strLong;
    	}
    	Long longTime = Long.parseLong(strLong);
    	return toDate(longTime);
    }
	public OrderExtVo toOrder() {
   	 OrderExtVo o = new OrderExtVo();
   	 o.setCreatedTime(toDate(this.getCreateTime()));
   	 o.setId(this.getId());
//   	 o.setAccountAmount(this.getAccountAmount());
   	 o.setBarcode(this.getBarcode());
//   	 o.setBeginCreatedTime(beginCreatedTime);
   	 o.setPayTime(toDate(this.getPayTime()));
   	 o.setBranchCode(this.getBranchCode());
   	 o.setBranchId(this.getBranchId());
   	 o.setBeginUpdateTime(toDate(this.getUpdateTime()));
//   	 o.setBranchName(this.getbran);
//   	 o.setCreatedTime(this.getcr);
//   	 o.setDeptCode(this.getdept.getDeptCode());
//   	 o.setDeptId(this.getdept);
   	 o.setDeptName(this.getDeptName());
   	 o.setDoctorName(this.getDoctorName());
   	 
//   	 o.setEndPayTime(thi);
//   	 o.setExtraParams(this.getex);
   	 o.setId(this.getId());
//   	 o.setIdCardNo(this.getid this.getCardNo());
//   	 o.setIdCardType(this.getCardType());
//   	 o.setInsuranceAmount(this.getInsuranceAmount() == null ? 0 : (int)new Double(this.getInsuranceAmount())*100);
//   	 o.setIsInsurance(Short.parseShort(this.getIsInsurance()));
   	 o.setMedicalCardNo(this.getCardNo());
   	 o.setMedicalCardType( this.getCardType() == null ? 1 : this.getCardType().shortValue());
//   	 o.setMzFeeId(this.getmz);
   	 o.setOpenId(this.getOpenId());
   	 o.setOrderNo(this.getOrderNo());
   	 o.setOrderStatus(this.getClinicStatus().shortValue());
   	 o.setOrgCode(this.getHospitalCode());
   	 o.setOrgName(this.getHospitalName());
   	 o.setPayAmount(this.getTotalFee());
//   	 o.setPayCode(this.getpayco);
   	 o.setPayRealAmount(this.getPayFee());
   	 o.setPayStatus(this.getPayStatus().shortValue());
   	 o.setPlatformCode(this.getAppId());
   	 
//   	 o.setPlatformName(this.getappn);
   	 o.setTotalAmount(this.getTotalFee());
   	 o.setUserId(this.getUserId());
   	 o.setUserName(this.getPatientName());
//   	 o.setUserSex(this.getSerialNum());
   	 o.setMzFeeId(this.getMzfeeId());
   	 
   	 return o;
   	 
    }

}